# Contributor: Kay Thomas <kaythomas@pm.me>
# Maintainer: Kay Thomas <kaythomas@pm.me>
pkgname=ergo
pkgver=2.10.0
pkgrel=0
pkgdesc="A modern IRC server (daemon/ircd) written in Go"
url="https://ergo.chat"
arch="all"
license="MIT"
options="!check" # no test suite
makedepends="go"
subpackages="$pkgname-openrc"
pkgusers="ergo"
pkggroups="ergo"
install="$pkgname.pre-install"
source="$pkgname-$pkgver.tar.gz::https://github.com/ergochat/ergo/archive/refs/tags/v$pkgver.tar.gz
	ergo.initd
	ergo.confd
	ircd.yaml
	"

build() {
	make build
}

package() {
	install -Dm755 ergo "$pkgdir"/usr/bin/ergo

	install -Dm644 "$srcdir"/ircd.yaml \
		"$pkgdir"/etc/ergo/ircd.yaml

	install -dm755 -o ergo -g ergo \
		"$pkgdir"/var/ergo

	cp -a "$builddir"/languages \
		"$pkgdir"/var/ergo/languages

	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="
952ef22b28d8de0814f04ece55b8ff88f405f184d8ecfce45c4af63e8c53153786d0b685f9bfff7cdb53ad369914f07069436f43b5ab65816bb7410b02f34bf8  ergo-2.10.0.tar.gz
1fd4e2a31ebbf7ade88294b18e2705a6caac4f0b0d402a3f324f929cc786d2dee104f600ec4213817f1fd7f22fa10c1303307ee342eb57968be9dfba7851e912  ergo.initd
c9856c141ab4b8b2dee63996678613a787d1aae8345d8baa2df9bc4427306f00b71a8a0fd7e30fd4e7b78cece982ec189ca1e73e703f2617e353d30fbd736491  ergo.confd
cd1a59a8141f073d8b3f334529b0653a9439613f884508104e324ed71685dddb3730b433b47360015a04f9793880ce6c642efe4a6f7d60ae85c72c9560092e43  ircd.yaml
"
